package com.xyzh05.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;

@Entity
@Table(name="service_type")
@Searchable
@XmlRootElement
public class ServiceType extends BaseObject implements Serializable {
	private static final long serialVersionUID = 3976221904185403850L;
	
	private Long stId;
    private String stName;
    private String stDesc;
    private Long stBinary;
    private Long stObject;

    @Id @GeneratedValue(strategy=GenerationType.AUTO) @SearchableId
    @Column(name="st_id")
    public Long getStId() {
        return this.stId;
    }
    
    public void setStId(Long stId) {
        this.stId = stId;
    }
    
    @Column(name="st_name", nullable=false, length=50)
    @SearchableProperty
    public String getStName() {
        return this.stName;
    }
    
    public void setStName(String stName) {
        this.stName = stName;
    }
    
    @Column(name="st_desc", length=65535)
    @SearchableProperty
    public String getStDesc() {
        return this.stDesc;
    }
    
    public void setStDesc(String stDesc) {
        this.stDesc = stDesc;
    }
    
    @Column(name="st_binary")
    @SearchableProperty
    public Long getStBinary() {
        return this.stBinary;
    }
    
    public void setStBinary(Long stBinary) {
        this.stBinary = stBinary;
    }
    
    @Column(name="st_object")
    @SearchableProperty
    public Long getStObject() {
        return this.stObject;
    }
    
    public void setStObject(Long stObject) {
        this.stObject = stObject;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ServiceType pojo = (ServiceType) o;

        if (stName != null ? !stName.equals(pojo.stName) : pojo.stName != null) return false;
        if (stDesc != null ? !stDesc.equals(pojo.stDesc) : pojo.stDesc != null) return false;
        if (stBinary != null ? !stBinary.equals(pojo.stBinary) : pojo.stBinary != null) return false;
        if (stObject != null ? !stObject.equals(pojo.stObject) : pojo.stObject != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (stName != null ? stName.hashCode() : 0);
        result = 31 * result + (stDesc != null ? stDesc.hashCode() : 0);
        result = 31 * result + (stBinary != null ? stBinary.hashCode() : 0);
        result = 31 * result + (stObject != null ? stObject.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("stId").append("='").append(getStId()).append("', ");
        sb.append("stName").append("='").append(getStName()).append("', ");
        sb.append("stDesc").append("='").append(getStDesc()).append("', ");
        sb.append("stBinary").append("='").append(getStBinary()).append("', ");
        sb.append("stObject").append("='").append(getStObject()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
